/**
 * 
 */
package com.gopay.common.domain.riskcontrol;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Version;

import com.gopay.common.cipher.utils.SensitiveInfoUtils;
import com.gopay.common.domain.BaseEntity;

/**
 * 风险控制-风险名单
 * 
 * @RcListing.java
 * @author xuan
 * @2016年1月18日 下午7:01:39 www.gopay.com.cn Inc.All rights reserved.
 */
@Entity
@Table(name = "RC_LISTING")
public class RcListing extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * 风险客户表主键
	 */
	
	private Long id;
	/**
	 * 账户
	 */
	
	private String custId;
	
	/**
	 * 用户类型（个人:1、企业:2）
	 */
	
	private String custType;
	
	/**
	 * 名单类型(01：灰名单02：黑名单)
	 */
	
	private String type;
	
	/**
	 * 名单来源（01：自主创建02：可疑交易转入）
	 */
	
	private String source;
	
	/**
	 * 移入风险名单描述、原因
	 */

	private String des;
	
	/**
	 * 状态（01：正常02：移除）
	 */
	
	private String stat;
	
	/**
	 * 交易类型
	 */
   
    private String gopayIntTxnCd;
    
    /**
     * 虚拟账号
     */
  
	private String acctId;
    
    /**
     * 交易号
     */
 
    private String gopayOrderId;
	/**
	 * 创建人
	 */
	
    private String createdOperId;
	
	/**
	 * 创建时间
	 */

    private Date createdTs;
	
	/**
	 * 移除人
	 */
	
    private String lastUptOperId;
	
	/**
	 * 移除时间
	 */
	
    private Date lastUptTs;
	
	/**
	 * 乐观锁版本号
	 */
	
    private int version;

	/**
	 * 邮箱或手机
     */

	private String emailMob;

	/**
	 * 营业执照号码
	 */
	
	private String businessLicenseNo;

	/**
	 * 组织机构代码
	 */
	
	private String organizationCode;

	/**
	 * 纳税人识别号
	 */
	
	private String taxpayerCode;

	/**
	 * 社会信用代码
	 */
	
	private String creditCode;//社会信用代码

	/**
	 * 用户名
	 */
	
	private String custName;

	/**
	 * 证件号码
	 */
	
	private String certNo;

	/**
	 * 备注
	 */
	
	private String remark;

	/**
	 * 处理原因
	 */
	
	private String handlereason;

	/** 是否绑定规则(0-未绑定灰名单规则 1-已绑定灰名单规则) */
	
	private String isBindRule;

	/**规则移入时间*/
	
	private Date ruleCreatedTs;
	

	/**
	 * @return the id
	 */
	 @Id
	@SequenceGenerator(name = "RC_LISTING_SEQ_GENERATOR", sequenceName = "RC_LISTING_SEQ", allocationSize = 1)
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "RC_LISTING_SEQ_GENERATOR")
	@Column(name = "ID")
	public Long getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return the custId
	 */
	 @Column(name="CUST_ID")
	public String getCustId() {
		return custId;
	}

	/**
	 * @param custId the custId to set
	 */
	public void setCustId(String custId) {
		this.custId = custId;
	}

	/**
	 * @return the custType
	 */
	@Column(name="CUST_TYPE")
	public String getCustType() {
		return custType;
	}

	/**
	 * @param custType the custType to set
	 */
	public void setCustType(String custType) {
		this.custType = custType;
	}

	/**
	 * @return the type
	 */
	@Column(name="TYPE")
	public String getType() {
		return type;
	}

	/**
	 * @param type the type to set
	 */
	public void setType(String type) {
		this.type = type;
	}

	/**
	 * @return the source
	 */
	
	@Column(name="SOURCE")
	public String getSource() {
		return source;
	}

	/**
	 * @param source the source to set
	 */
	public void setSource(String source) {
		this.source = source;
	}

	/**
	 * @return the des
	 */
	@Column(name="DES")
	public String getDes() {
		return des;
	}

	/**
	 * @param des the des to set
	 */
	public void setDes(String des) {
		this.des = des;
	}

	/**
	 * @return the stat
	 */
	 @Column(name="STAT")
	public String getStat() {
		return stat;
	}

	/**
	 * @param stat the stat to set
	 */
	public void setStat(String stat) {
		this.stat = stat;
	}

	/**
	 * @return the createdOperId
	 */
	 @Column(name="CREATED_OPER_ID")
	public String getCreatedOperId() {
		return createdOperId;
	}

	/**
	 * @param createdOperId the createdOperId to set
	 */
	public void setCreatedOperId(String createdOperId) {
		this.createdOperId = createdOperId;
	}

	/**
	 * @return the createdTs
	 */
	@Column(name="CREATED_TS")
	public Date getCreatedTs() {
		return createdTs;
	}

	/**
	 * @param createdTs the createdTs to set
	 */
	public void setCreatedTs(Date createdTs) {
		this.createdTs = createdTs;
	}

	/**
	 * @return the version
	 */
	 
	@Version
	@Column(name="VERSION")
	public int getVersion() {
		return version;
	}

	/**
	 * @param version the version to set
	 */
	public void setVersion(int version) {
		this.version = version;
	}

	/**
	 * @return the gopayIntTxnCd
	 */
	@Column(name="GOPAY_INT_TXN_CD")
	public String getGopayIntTxnCd() {
		return gopayIntTxnCd;
	}

	/**
	 * @param gopayIntTxnCd the gopayIntTxnCd to set
	 */
	public void setGopayIntTxnCd(String gopayIntTxnCd) {
		this.gopayIntTxnCd = gopayIntTxnCd;
	}

	/**
	 * @return the acctId
	 */
	@Column(name="ACCT_ID")
	public String getAcctId() {
		return acctId;
	}

	/**
	 * @param acctId the acctId to set
	 */
	public void setAcctId(String acctId) {
		this.acctId = acctId;
	}

	/**
	 * @return the gopayOrderId
	 */
	@Column(name="GOPAY_ORDER_ID")
	public String getGopayOrderId() {
		return gopayOrderId;
	}

	/**
	 * @param gopayOrderId the gopayOrderId to set
	 */
	public void setGopayOrderId(String gopayOrderId) {
		this.gopayOrderId = gopayOrderId;
	}

	/**
	 * @return the lastUptOperId
	 */
	 @Column(name="LAST_UPT_OPER_ID")
	public String getLastUptOperId() {
		return lastUptOperId;
	}

	/**
	 * @param lastUptOperId the lastUptOperId to set
	 */
	public void setLastUptOperId(String lastUptOperId) {
		this.lastUptOperId = lastUptOperId;
	}

	/**
	 * @return the lastUptTs
	 */
	 @Column(name="LAST_UPT_TS")
	public Date getLastUptTs() {
		return lastUptTs;
	}

	/**
	 * @param lastUptTs the lastUptTs to set
	 */
	public void setLastUptTs(Date lastUptTs) {
		this.lastUptTs = lastUptTs;
	}
	
	@Column(name="EMAIL_MOB")
	public String getEmailMob() {
		
		/**
		 * modify by ssj，2017-4-13在程序中获取的时候进行解密操作，如果是hibernate自己调用（save等），则返回原值；
		 */
		this.emailMob = SensitiveInfoUtils.autoReencrypt(this.emailMob);
		return SensitiveInfoUtils.smartDecryptWithCheck(this.emailMob);
//		return emailMob;
	}

	public void setEmailMob(String emailMob) {
		/**
    	 * modified by ssj，2017-4-13 判断传入字符串是否经过加密，如果是，则设置为原文，否则设置为加密后的值
		 */
		this.emailMob = SensitiveInfoUtils.smartEncryptWithCheck(emailMob);
//		this.emailMob = emailMob;
	}
	
    @Column(name="BUSINESS_LICENSE_NO")
	public String getBusinessLicenseNo() {
		return businessLicenseNo;
	}

	public void setBusinessLicenseNo(String businessLicenseNo) {
		this.businessLicenseNo = businessLicenseNo;
	}
	
    @Column(name="ORGANIZATION_CODE")
	public String getOrganizationCode() {
		return organizationCode;
	}

	public void setOrganizationCode(String organizationCode) {
		this.organizationCode = organizationCode;
	}
	
    @Column(name="TAXPAYER_CODE")
	public String getTaxpayerCode() {
		return taxpayerCode;
	}

	public void setTaxpayerCode(String taxpayerCode) {
		this.taxpayerCode = taxpayerCode;
	}
	
    @Column(name="CREDIT_CODE")
	public String getCreditCode() {
		return creditCode;
	}

	public void setCreditCode(String creditCode) {
		this.creditCode = creditCode;
	}
	
    @Column(name="CUST_NAME")
	public String getCustName() {
    	/**
		 * modify by ssj，2017-04-13 在程序中获取的时候进行解密操作，如果是hibernate自己调用（save等），则返回原值；
		 */
		this.custName = SensitiveInfoUtils.autoReencrypt(this.custName);
		return SensitiveInfoUtils.smartDecryptWithCheck(this.custName);
//		return custName;
	}

	public void setCustName(String custName) {
	 	/**
    	 * modified by ssj，2017-04-13 判断传入字符串是否经过加密，如果是，则设置为原文，否则设置为加密后的值
		 */
		this.custName = SensitiveInfoUtils.smartEncryptWithCheck(custName);
//		this.custName = custName;
	}
	
    @Column(name="CERT_NO")
	public String getCertNo() {
    	/**
		 * modify by zyt，2017-2-22 在程序中获取的时候进行解密操作，如果是hibernate自己调用（save等），则返回原值；
		 */
		this.certNo = SensitiveInfoUtils.autoReencrypt(this.certNo);
		return SensitiveInfoUtils.smartDecryptWithCheck(this.certNo);
    	
//		return certNo;
	}

	public void setCertNo(String certNo) {
		/*
    	 * modified by zyt，2017-2-22 判断传入字符串是否经过加密，如果是，则设置为原文，否则设置为加密后的值
		 */
		this.certNo = SensitiveInfoUtils.smartEncryptWithCheck(certNo);
//		this.certNo = certNo;
	}
	
    @Column(name="REMARK")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
	
    @Column(name="HANDLEREASON")
	public String getHandlereason() {
		return handlereason;
	}

	public void setHandlereason(String handlereason) {
		this.handlereason = handlereason;
	}
	
    @Column(name="IS_BIND_RULE")
	public String getIsBindRule() {
		return isBindRule;
	}

	public void setIsBindRule(String isBindRule) {
		this.isBindRule = isBindRule;
	}
	
   @Column(name="RULE_CREATED_TS")
	public Date getRuleCreatedTs() {
		return ruleCreatedTs;
	}

	public void setRuleCreatedTs(Date ruleCreatedTs) {
		this.ruleCreatedTs = ruleCreatedTs;
	}
}
